#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2025/3/16 11:11
# @File           : order
# @IDE            : PyCharm
# @desc           : 描述

from typing import Optional, Union
from pydantic import BaseModel, ConfigDict, computed_field
from core.data_types import DatetimeStr


class OrderSearch(BaseModel):
    project: Optional[str] = None
    docNum: Optional[str] = None
    eff: Optional[str] = None
    docName: Optional[str] = None
    station: Optional[str] = None
    
    pageNum: Union[int, str]
    pageSize: Union[int, str]

    @computed_field
    def page(self) -> int:
        return int(self.pageNum)
    
    @computed_field
    def limit(self) -> int:
        return int(self.pageSize)

class OrderDetailSearch(BaseModel):
    id: Optional[str] = None
    serNo: Optional[str] = None
    